#encoding = utf-8

import pytest
import requests
import json

from shargeApi.config import url_logout
from shargeApi.login import LoginAPI
import allure

@allure.epic("sharge")
@allure.feature("logintest")
class Testusrmode:

    def setup(self):
        pass

    def teardown(self):
        pass

    @allure.title("登出账号测试")
    def test01_logout(self):
        sessionId = LoginAPI().login_sessionid()
        url = url_logout
        json_data = {}
        jsondata = json.dumps(json_data)
        headers = {"Content-Type": "application/json",
                   "sessionId": sessionId,
                   "userid":"1864581368354725890"}
        res = requests.post(url=url, data=jsondata.encode('utf-8'), headers=headers)
        result = json.dumps(res.json(), indent=2, ensure_ascii=False)

        print(result)

